class Person:
    pass

class Worker(Person):
    pass
class Student(Person):
    pass
class Teacher(Person):
    pass

class Factory:
    def get_person(self,p_type):
        if p_type == 'a':
            return Worker()
        elif p_type == 's':
            return Student()
        else:
            return Teacher()